import { requestNew } from '@/utils/request'

// 申请发票
export async function applyInvoice(data = {}) {
  const res = await requestNew({
    url: '/invoice-app-api/invoice/apply',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
  return res
}

// 发票详情
export async function getInvoiceDetail(data = {}) {
  const res = await requestNew({
    url: '/invoice-app-api/invoice/detail',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
  return res
}

// 重新申请
export async function reApplyInvoice(data = {}) {
  const res = await requestNew({
    url: '/invoice-app-api/invoice/reapply',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
  return res
}

// 发送邮件
export async function sendEmail(data = {}) {
  const res = await requestNew({
    url: '/invoice-app-api/invoice/send/email',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
  return res
}

// 发票配置
export async function getInvoiceSetting(params = {}) {
  const res = await requestNew({
    url: '/invoice-app-api/invoice/setting',
    method: 'get',
    params
  })
  return res
}
